package com.mayikt.lock;

import com.mayikt.lock.MayiktAbstractQueuedSynchronizer;

/**
 * @ClassName MayiktLOck
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class MayiktReentrantLock extends MayiktAbstractQueuedSynchronizer {

    public void lock() {
        if (compareAndSetState(0, 1))
            setExclusiveOwnerThread(Thread.currentThread());
        else
            acquire(1);
    }

}
